window.list=window.list||{};
list.Ranking=function(){
	var s = this;
	annie.Sprite.call(s);
	/*_a2x_need_start*/s.count_txt=null;s.listCon=null;s.raing_btn=null;s.returnHome_btn=null;s.start_btn=null;/*_a2x_need_end*/
	annie.initRes(s,"list","Ranking");
	s.start_btn.addEventListener(annie.MouseEvent.CLICK,function (e) {
        annie.globalDispatcher.dispatchEvent("onChangeCont", {cont: "gamePage"})
    })
	s.returnHome_btn.addEventListener(annie.MouseEvent.CLICK,function (e) {
        annie.globalDispatcher.dispatchEvent("onChangeCont", {cont: "homePage"})
    })
	s.raing_btn.addEventListener(annie.MouseEvent.CLICK,function (e) {
        annie.return = "listPage";
        annie.globalDispatcher.dispatchEvent("onChangeCont", {cont: "allList"})
    })

	s.addEventListener(annie.Event.ADD_TO_STAGE,function (e) {
		s.count_txt.text = annie.kmNum;
        rankingManager.saveScore(annie.kmNum,function (e) {
            var result = e;
            // var result = JSON.parse(e);
            if (result.status == 0){
                rankingManager.rankingOwn(s,list.RingItem);
            }
        });
    })
};
A2xExtend(list.Ranking,annie.Sprite);
